import { ref, onMounted, onUnmounted} from "vue"

export default function(){
    const x = ref(-1)
    const y = ref(-1)
    const handlerClick = (event:any)=>{
        x.value = event.pageX;
        y.value = event.pageY;
    }
    onMounted(()=>{
        window.addEventListener("click",handlerClick)
    })
    onUnmounted(()=>{
        window.removeEventListener("click",handlerClick)
    })
    return{
        x,
        y
    }
}